package com.tencent.iov.cowin.befsale.clue.value.utils;

import com.software.boot.common.entity.Response;
import com.software.boot.common.exception.BusinessException;
import com.software.boot.common.exception.NEError;

import java.util.Objects;

/**
 * @Author: Caychen
 * @Date: 2020/12/7 17:45
 * @Description:
 */
public class ResponseUtil {

    public static Boolean isSuccess(Response response) {
        if (response == null) {
            throw new BusinessException(NEError.BUSINESS_ERROR, "调用下游接口失败");
        }
        return Objects.equals(response.getCode(), Response.CODE_SUCCESS);
    }
}
